import $ from "@/utils/requset"
// 列表
const UserApi = (pagenum, pagesize) => $.getAxios('/users', {
    pagenum,
    pagesize
})
// 添加用户
const AddApi = (obj) => $.postAxios('/users', obj)
// 删除
const DeleteApi = (id) => $.deleteAxios('/users/' + id)
//修改信息
const SetApi = (obj) => $.putAxios('/users/' + obj.id, obj)
// 修改状态
const SetStateApi = (obj) => $.putAxios('users/' + obj.id + '/state/' + obj.state)
//获取角色
const RolesApi = () => $.getAxios('/roles',)
// 修改角色
const SetRolesApi = (obj) => $.putAxios('users/' + obj.id + '/role')
//搜索
const SearchApi = (id) => $.getAxios('/users/' + id,)

export default {
    UserApi,
    AddApi,
    DeleteApi,
    SetApi,
    SetStateApi,
    RolesApi,
    SetRolesApi,
    SearchApi
}